package com.tcs.bean.init;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.tcs.config.IProxyPoolConfig;
import com.tcs.model.porxypool.proxyPoolBean;
import com.tcs.util.constant.SystemConstants;
import com.tcs.util.staticpack.StaticPack;

@Service(value="proxyBeanInit")
public class ProxyBeanInit implements IProxyBeanInit {
	
	private final Logger logger = LoggerFactory.getLogger(ProxyBeanInit.class);
	
	@Resource(name="proxyPoolConfig")
	private IProxyPoolConfig proxyPoolConfig;
	
	@Resource(name="staticPack")
	private StaticPack<String, proxyPoolBean> staticPack;

	@Override
	public void init() {
		proxyPoolBean ProxyPoolBean = proxyPoolConfig.getProxyPoolModel();
		staticPack.put(SystemConstants.ProxyPool.PROXYPOOLMODEL, ProxyPoolBean);
		logger.info("ProxyPoolBean : {} " , ProxyPoolBean);
	}
}